<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:sec="http://www.springframework.org/security/tags">
<h:head>
	<title>DJ</title>
</h:head>
<style>
.c1 {
	width: 80%;
	text-align: center;
}

.c2 {
	width: 20%;
	text-align: right;
}
</style>
<h:body>
	<link
		href="#{facesContext.externalContext.requestContextPath}/css/default.css"
		rel="stylesheet" type="text/css" />
	<p:dialog widgetVar="dlgStatus" modal="true" header="Status"
		draggable="false" closable="false" width="250" resizable="false">
		<h:panelGrid columns="1" style="text-align:center">
			<h:outputText value="Página carregando." />
			<p:graphicImage value="imagens/loadingbar.gif" />
		</h:panelGrid>
	</p:dialog>
	<p:dialog widgetVar="dlgLogin" modal="true" header="Login"
		draggable="false" closable="true" width="280" resizable="false">
		<h:form>
			<h:panelGrid columns="2">
				<h:outputLabel value="Usuario" for="j_username" />
				<h:inputText id="j_username" value="#{loginBean.username}"
					required="true" />
				<h:outputText value="Senha" for="j_password" />
				<h:inputSecret id="j_password" value="#{loginBean.password}"
					required="true" />
			</h:panelGrid>
			<h:commandButton action="#{loginBean.doLogin}" value="Login" />
			<h:messages style="color: red;" />
		</h:form>
	</p:dialog>
	<p:layout fullPage="true">
		<p:layoutUnit position="center">
			<p:ajaxStatus onprestart="dlgStatus.show();"
				oncomplete="dlgStatus.hide();" />
			<p:growl id="growl" sticky="false" />
			<p:panel id="alvo" header="Título da Página Aberta"
				style="heigh:100%">
				<table style="width: 100%; height: 95%">
					<tr>
						<td rowspan="2"><p:panel header="Notícias"
								style="height:100%" /></td>
						<td><p:panel header="Álbuns" style="height:100%">
								<h:form>
									<p:ring id="basic" value="#{albumManagedBean.listaDeAlbuns}"
										var="album">
										<p:column>
											<h:outputLabel value="#{album.nome}" />
										</p:column>
									</p:ring>
									<f:facet name="header">
										<p:menu>
											<p:submenu label="Settings">
												<p:menuitem value="Alterar" url="#" icon="ui-icon-pencil" />
											</p:submenu>
										</p:menu>
									</f:facet>
								</h:form>
							</p:panel></td>
					</tr>
					<tr>
						<td><p:panel header="Enquete" style="height:100%" /></td>
					</tr>
				</table>
			</p:panel>
		</p:layoutUnit>

		<p:layoutUnit position="south" size="52">
			<h:panelGrid style="width:100%" columns="2" columnClasses="c1,c2">
				<h:outputLabel style="font-size:10px">Direitos Autorais</h:outputLabel>
				<h:form>
					<sec:authorize ifNotGranted="ROLE_ADMIN">
						<p:commandButton onclick="dlgLogin.show();" value="Login"
							style="font-size: 0.7em;" />
					</sec:authorize>
					<sec:authorize ifAnyGranted="ROLE_ADMIN">
						<p:commandButton action="#{loginBean.doLogoff}" value="Logout"
							ajax="false" style="font-size: 0.7em;" />
						<!-- p:commandButton value="Logout" action="j_spring_security_logout"
							ajax="false" style="font-size: 0.7em;" /-->
					</sec:authorize>
				</h:form>
			</h:panelGrid>
		</p:layoutUnit>
	</p:layout>
</h:body>
</html>